import request from "@/api/request.js"

// 获取购物车列表
function findAllCartItem(){
	return request({
		url:"/lejuClient/cart/findAllCartItem"
	})
}
// 添加到购物车
function addCart(data){
	return request({
		url:"/lejuClient/cart/addCart",
		data:data,
		method:"POST"
	})
}
// 删除购物车信息
function delCartItems(data){
	return request({
		url:"/lejuClient/cart/delCartItems",
		data:data,
		method:"POST"
	})
}
// 订单模块 
//生成确认单
function addPreOrder(data){
	return request({
		url:"/lejuClient/order/addPreOrder",
		data:data,
		method:"POST"
	})
}
// 根据订单id获取订单明细
function getPreOrderById(orderId){
	return request({
		url:`/lejuClient/order/getPreOrderById/${orderId}`
	})
}
//提交确认单
function addConfirmOrder(data){
	return request({
		url:"/lejuClient/order/addConfirmOrder",
		data:data,
		method:"POST"
	})
}
export{
	findAllCartItem,
	delCartItems,
	addPreOrder,
	getPreOrderById,
	addConfirmOrder
}